<template>
  <div class="searchBar">
    <input type="text" placeholder="输入学生ID跳转学生界面" v-model="Getid" width="30vw" />&nbsp;

    <router-link :to="{ path: '/StudentSingle', query: { id: Getid } }" class="searchBtn">
      跳转
    </router-link>

  </div>
</template>

<script setup>
import { ref } from "vue";

const Getid = ref("");
//template中的变量都要进行声明，否则用不上去

</script>

<style scoped>
input {
  box-sizing: border-box;
  height: 40px;
  width: 40vw;

  border: none;
  padding: 1px 1px;
  border-radius: 4px;
  background-color: rgb(202, 203, 207);
  color: #7d7e81;
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  margin-bottom: 10px;
}

input:focus {
  outline: none;
  border-color: #409eff;
  box-shadow: 0 0 5px rgba(16, 142, 233, 0.2);
}

.searchBtn {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px;
  color: #fff;
  background-color: #007bff;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}
</style>
